--- import type { GetStaticPaths, InferGetStaticPropsType } from "astro"; import { getCollection } from "astro:content"; import Layout from "../layouts/BaseLayout.astro"; import Pagination from "../components/Pagination.astro"; import PostSummary from "../components/PostSummary.astro"; export const getStaticPaths = (async ({ paginate }) => { const posts = await getCollection("blog"); posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); return paginate(posts, { pageSize: 5, }); }) satisfies GetStaticPaths; type Props = InferGetStaticPropsType<typeof getStaticPaths>; const { page } = Astro.props; --- <Layout> <section> {page.data.map((post) => <PostSummary post={post} />)} </section> <section> <Pagination prevUrl={page.url.prev} nextUrl={page.url.next} /> </section> </Layout>